<template>
    <Layout :style="{windth:'100%', height: '100%', padding: '0 5px'}">
        <Row :gutter="16" style="margin-top: 10px">
            <i-col span="8">
                <Card dis-hover>
                    <div class="top_common_title">
                        <p class="top_common_title_left_title">本月环保检查计划</p>
                    </div>
                    <div ref="pipelineContainer" style="width: 100%; height: 275px"></div>
                </Card>
            </i-col>
            <i-col span="8">
                <Card dis-hover>
                    <div class="top_common_title">
                        <p class="top_common_title_left_title">数据统计</p>
                    </div>
                    <div class="other-people">
                        <Row :gutter="16">
                            <Col span="12">
                                <div class="info-div" @click="toViewJC(1)">
                                    <div class="info-div-left">
                                        <img class="info-div-left-img" src="../../../assets/door/zfhjjq.png"/>
                                    </div>
                                    <div class="info-div-right">
                                        <span class="info-div-right-title">内部环保检查</span>
                                        <div class="info-div-right-bottom">
																					<!-- totalEnInspect2 -->
                                            <span class="info-div-right-num">{{ statisticsInfos.saSuperviseInspectNum }}</span>
                                            <span class="info-div-right-danwei">次</span>
                                        </div>
                                    </div>
                                </div>
                            </Col>
                            <Col span="12">
                                <div class="info-div" @click="toViewZWUTQYJ()">
                                    <div class="info-div-left">
                                        <img class="info-div-left-img" src="../../../assets/door/wrtqyj.png"/>
                                    </div>
                                    <div class="info-div-right">
                                        <span class="info-div-right-title">重污染天气预警</span>
                                        <div class="info-div-right-bottom">
                                            <span class="info-div-right-num">{{ statisticsInfos.warningDays }}</span>
                                            <span class="info-div-right-danwei">天</span>
                                        </div>
                                    </div>
                                </div>
                            </Col>
                        </Row>
                        <Row :gutter="16">
                            <Col span="12">
                                <div class="info-div" @click="toViewHBXZ()">
                                    <div class="info-div-left">
                                        <img class="info-div-left-img" src="../../../assets/door/jjss.png"/>
                                    </div>
                                    <div class="info-div-right">
                                        <span class="info-div-right-title">环保行政处罚</span>
                                        <div class="info-div-right-bottom">
                                            <span class="info-div-right-num">{{ statisticsInfos.administrativeSanction }}</span>
                                            <span class="info-div-right-danwei">起</span>
                                        </div>
                                    </div>
                                </div>
                            </Col>
                            <Col span="12">
                                <div class="info-div" @click="toViewHJBZH()">
                                    <div class="info-div-left">
                                        <img class="info-div-left-img" src="../../../assets/door/aqhy.png"/>
                                    </div>
                                    <div class="info-div-right">
                                        <span class="info-div-right-title">环境标准化验收</span>
                                        <div class="info-div-right-bottom">
                                            <span class="info-div-right-num">{{ statisticsInfos.evaluationResult}}</span>
                                            <span class="info-div-right-danwei">家</span>
                                        </div>
                                    </div>
                                </div>
                            </Col>
                        </Row>
                        <Row :gutter="16">
                            <Col span="12">
                                <div class="info-div" @click="toViewHBWT()">
                                    <div class="info-div-left">
                                        <img class="info-div-left-img" src="../../../assets/door/aqhy.png"/>
                                    </div>
                                    <div class="info-div-right">
                                        <span class="info-div-right-title">待闭环问题</span>
                                        <div class="info-div-right-bottom">
                                            <span class="info-div-right-num">{{ statisticsInfos.enAccountNum }}</span>
                                            <span class="info-div-right-danwei">个</span>
                                        </div>
                                    </div>
                                </div>
                            </Col>
                            <Col span="12">
                                <div class="info-div" @click="toViewJDJC()">
                                    <div class="info-div-left">
                                        <img class="info-div-left-img" src="../../../assets/door/pxcs.png"/>
                                    </div>
                                    <div class="info-div-right">
                                        <span class="info-div-right-title">监督检查</span>
                                        <div class="info-div-right-bottom">
                                            <span class="info-div-right-num">{{  statisticsInfos.enSuperviseInspectNum}}</span>
                                            <span class="info-div-right-danwei">次</span>
                                        </div>
                                    </div>
                                </div>
                            </Col>
                        </Row>
                    </div>
                </Card>
            </i-col>
            <i-col span="8">
                <Card dis-hover>
                    <div class="top_common_title">
                        <p class="top_common_title_left_title">我的待办</p>
                    </div>
                    <div style="width: 100%; height: 275px">
                        <Table border :height="280" :disabled-hover="true" no-data-text="暂无待办"
                               :columns="todoColumns" :data="todoListData"></Table>
                    </div>
                </Card>
            </i-col>
        </Row>
        <Row :gutter="16" style="margin-top: 10px">
            <i-col span="8">
                <Card dis-hover>
                    <div class="top_common_title">
                        <p class="top_common_title_left_title">风险等级统计</p>
                    </div>
                    <Spin fix v-if="riskSkip"></Spin>
                    <div ref="derContainer" style="width: 100%; height: 275px"></div>
                </Card>
            </i-col>

            <i-col span="8">
                <Card dis-hover>
                    <div class="top_common_title">
                        <p class="top_common_title_left_title">各二级集团一级风险与共计家数</p>
                    </div>
                    <div ref="oneRiskAndCompanyNumContainer" style="width: 100%; height: 275px"></div>
                </Card>
            </i-col>

            <i-col span="8">
                <Card dis-hover>
                    <div class="top_common_title">
                        <p class="top_common_title_left_title">我的通知</p>
                    </div>
                    <div style="width: 100%; height: 275px">
                        <Table border :height="280" :disabled-hover="true" no-data-text="暂无通知"
                               :columns="noticeColumns" :data="noticeListData"></Table>
                    </div>
                </Card>
            </i-col>
        </Row>

        <Row :gutter="16" style="margin-top: 10px">
            <i-col span="8">
                <Card dis-hover>
                    <div class="top_common_title">
                        <p class="top_common_title_left_title">任务书情况</p>
                    </div>
                    <div style="width: 100%; height: 275px">
                        <Table border :height="280" :disabled-hover="true" no-data-text="暂无任务书"
                               :columns="taskBookColumns" :data="taskBookListData"></Table>
                    </div>
                </Card>
            </i-col>
            <i-col span="8">
                <Card dis-hover>
                    <div class="top_common_title">
                        <p class="top_common_title_left_title">不可控风险地图</p>
                    </div>
                    <Spin fix v-if="mapContainerSkip"></Spin>
                    <div ref="mapContainer" style="width: 100%; height: 275px"></div>
                </Card>
            </i-col>

            <i-col span="8">
                <Card dis-hover>
                    <div class="top_common_title">
                        <p class="top_common_title_left_title">用户手册</p>
                        <router-link class="top_common_title_right" style="margin-left: auto;"
                                     :to="{path:'/modular',query:{id:'10008',fastMenu:'displayTraining',params:paramMap}}">更多>
                            <!--:to="{path:'/displayTraining'}">更多>-->
                        </router-link>
                    </div>
                    <div style="width: 100%; height: 275px">
                        <Spin fix v-if="userManualSkip"></Spin>
                        <Row style="background-color: white;" >
                            <Col span="8" v-for="item in userManualList">
                                <router-link :class="'statisticsDiv'+item.num%3" style="margin-left: auto;"
                                             :to="{path:'/modular',query:{id:'10008',fastMenu:'displayTraining',params:item}}">
                                <!--<div :class="'statisticsDiv'+item.num%3" >-->
                                    <div class="rowDiv">
                                        <p>{{item.title}}</p>
                                    </div>
                                <!--</div>-->
                                </router-link>
                            </Col>
                        </Row>
                    </div>
                </Card>
            </i-col>
        </Row>

        <Row :gutter="16" style="margin-top: 10px">
            <i-col span="8">
                <Card dis-hover>
                    <div class="top_center_leader">
                        <div class="top_common_title">
                            <p class="top_common_title_left_title">公示台账</p>
                            <router-link class="top_common_title_right" style="margin-left: auto;"
                                         :to="{path:'/wholePage',query:{name: '公示台账(环保)', type: '6',accountType:2}}">更多>
                            </router-link>
                        </div>
                        <div class="top_artical_div">
                            <Spin fix v-if="proPublicitySkip"></Spin>
                            <ul class="articals">
                                <li class="artical" v-for="(item,index) in proPublicity[2]">
                                    <div class="articals_child">
                    <span class="articals_child_title">
                      <tooltip placement="top-start" max-width="300">
                        {{ '('+item.checkLevelName+')'+item.problemDesc }}
                        <div slot="content">
                           <p>归属地区: {{item.attriEreaName}}</p>
                          <p>问题发现组织: {{item.checkLevelName}}</p>
                          <p>问题类别: {{item.problemCategoryName}}</p>
                          <p>问题描述: {{item.problemDesc}}</p>
                        </div>
                      </tooltip>
                    </span>
                                        <p class="articals_child_date">{{ formatDate(new Date(item.createDate),
                                            'yyyy-MM-dd') }}</p>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </Card>
            </i-col>
            <i-col span="8">
                <Card dis-hover>
                    <div class="top_center_leader">
                        <div class="top_common_title">
                            <p class="top_common_title_left_title">科普宣教</p>
                            <router-link class="top_common_title_right" style="margin-left: auto;"
                                         :to="{path:'/wholePage',query:{name: '科普宣教', type: '4',accountType:0}}">更多>
                            </router-link>
                        </div>
                        <div class="top_artical_div">
                            <Spin fix v-if="popularizationSkip"></Spin>
                            <ul class="articals">
                                <li class="artical" v-for="(item,index) in popularization['environment']">
                                    <div class="articals_child">
                                        <!--<router-link   class="articals_child_title" target="_blank" :to="{path:'/popularizationPlay',query:{id: item.popularizationId}}">{{item.title}}</router-link>-->
                                        <router-link class="articals_child_title" target="_blank"
                                                     :to="{path: '/noticeDetail', query:{source: 'popularization', id:item.popularizationId,name:item.title,createDate:item.createDate, browse: item.browse, type:item.type==1?4:item.type==0?5:2}}">
                                            {{ item.title }}
                                        </router-link>
                                        <p class="articals_child_date">{{ item.createDate }}</p>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>

                </Card>
            </i-col>

            <i-col span="8">
                <Card dis-hover>
                    <div class="top_center_leader">
                        <div class="top_common_title">
                            <p class="top_common_title_left_title">通知公告</p>
                            <router-link class="top_common_title_right" style="margin-left: auto;"
                                         :to="{path:'/wholePage',query:{name: '通知公告', type: '2',accountType:0}}">更多>
                            </router-link>
                        </div>
                        <div class="top_artical_div">
                            <Spin fix v-if="noticeSkip"></Spin>
                            <ul class="articals">
                                <li class="artical" v-for="(item,index) in notices['environment']">
                                    <div class="articals_child">
                                        <div style="display:flex;flex:auto;width:0">
                                            <router-link class="articals_child_title_notice" target="_blank"
                                                         :to="{path:'/noticeDetail',query:{id:item.proposalId,type:0,userId:currentUserId}}"
                                                         @click.native="enterNotice(index)">{{ item.title }}
                                            </router-link>
                                            <span v-if="item.isBrowsed != '1'" class="red_point"></span>
                                        </div>
                                        <p class="articals_child_date">{{ item.createDate }}</p>
                                    </div>
                                </li>
                            </ul>

                        </div>
                    </div>
                </Card>
            </i-col>
        </Row>


        <Modal title="不可控风险详情" :transfer=false v-model="mapContainerDetailVisible"
               :width=1200 footer-hide>
            <Table ref='table' :loading="detailLoading"  size="small" :height=500 no-data-text="没有查询到相关数据!"
                   highlight-row stripe border :columns="mapContainerColumns" width="100%" :data="mapContainerDetailInfos">
            </Table>
        </Modal>
        <Modal :title="ZYXKTitle" :transfer=false v-model="ZYXKVisible" :width=1200 footer-hide>
            <Table ref='table' :loading="loading" size="small" class="table" :height=500 no-data-text="没有查询到相关数据!"
                   highlight-row stripe border :columns="ZYXKColumns" width="100%" :data="ZYXKInfo">
            </Table>
            <Page :total="pagedata1.total" :page-size="pagedata1.pageSize"
                  @on-change="pageChange1" @on-page-size-change='sizeChange1' show-total show-sizer show-elevator/>
        </Modal>
        <Modal :transfer=false v-model="StatisticsVisible" :width=1200 footer-hide>
            <Tabs value="name1" ref="tabs">
                <TabPane :label="StatisticsTitle" name="name1">
                    <Table ref='table' v-if="AQJCVisible" :loading="loading" size="small" class="table" :height=500
                           no-data-text="没有查询到相关数据!"
                           highlight-row stripe border :columns="columns1" width="100%" :data="dataTable">
                    </Table>
                    <Table ref='table' v-if="ZDWRVisible" :loading="loading" size="small" class="table" :height=500
                           no-data-text="没有查询到相关数据!"
                           highlight-row stripe border :columns="columns2" width="100%" :data="dataTable">
                    </Table>
                   <Table ref='table' v-if="JDJCVisible" :loading="loading" size="small" class="table" :height=500
                           no-data-text="没有查询到相关数据!" 
                           highlight-row stripe border :columns="JDJCColumn" width="100%" :data="dataTable">
                    </Table>
                   <!-- <Table ref='table' v-if="AQXZVisible" :loading="loading" size="small" class="table" :height=500
                           no-data-text="没有查询到相关数据!"
                           highlight-row stripe border :columns="AQXZColumn" width="100%" :data="dataTable">
                    </Table> -->
                    <Table ref='table' v-if="HBXZVisible" :loading="loading" size="small" class="table" :height=500
                           no-data-text="没有查询到相关数据!"
                           highlight-row stripe border :columns="HBXZColumn" width="100%" :data="dataTable">
                    </Table>
                    <Table ref='table' v-if="HBWTisible" :loading="loading" size="small" class="table" :height=500
                           no-data-text="没有查询到相关数据!"
                           highlight-row stripe border :columns="HBWTColumn" width="100%" :data="dataTable">
                    </Table>
                    <Table ref='table' v-if="HJBZHVisible" :loading="loading" size="small" class="table" :height=500
                           no-data-text="没有查询到相关数据!"
                           highlight-row stripe border :columns="HJBZHColumn" width="100%" :data="dataTable">
                    </Table>
                    <Page :total="pagedata1.total" :page-size="pagedata1.pageSize"
                          @on-change="pageChange1" @on-page-size-change='sizeChange1' show-total show-sizer
                          show-elevator/>
                </TabPane>
                <TabPane label="统计分析" v-if="HBXZVisible" name="name2">
                    <div ref="analysisContainer" style="width: 1200px; height: 500px"></div>
                </TabPane>
            </Tabs>
        </Modal>


        <Modal :title="riskLevelTitle" :transfer=false v-model="riskLevelVisible" :width=1200 footer-hide>
            <Table :loading="loading" size="small" :height="500" class="table" no-data-text="没有查询到相关数据!"
                   highlight-row stripe border :columns="riskLevelColumns" width="100%" :data="riskLevelInfo">
            </Table>
            <Page :total="pagedata.total" :page-size="pagedata.pageSize"
                  @on-change="pageChangeRisk" @on-page-size-change='sizeChangeRisk' show-total show-sizer
                  show-elevator/>
        </Modal>
    </Layout>
</template>

<script>

    import echarts from 'echarts'
    import {Api} from '../../../api/index.js'
    import {sessionStorage} from '../../../common/cacheUtils.js';
    import pageCommonFunction from '../../../components/pageCommonFunction.js'

    export default {
        name: "homepage",
        components: {
        },
        data() {
            return {
                currentUserId: "",
                info: [],
                meetingTypeMap: {},
                trainingMethodsMap: {},
                evaluationMethodMap: {},
                dictMap: {},
                AQJCVisible: false,
                ZDWRVisible: false,
                ZYXKVisible: false,
                hiddenDangerTitle: '',
                dataTable: [],
                pagedata: {
                    total: 0, //总条数
                    fromPage: 1,//从n条开始
                    pageSize: 10//每页多少条
                },
                pagedata1: {
                    total: 0, //总条数
                    fromPage: 1,//从n条开始
                    pageSize: 10//每页多少条
                },
                infoObj: {},
                ZYXKInfo: [],
                ZYXKTitle: "",
                ZYXKColumns: [
                    {
                        title: '序号',
                        width: 100,
                        fixed: 'left',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
                        }
                    },
                    {
                        minWidth: 150,
                        title: '任务名称',
                        fixed: 'left',
                        key: 'planName',
                        align: 'center'
                    },
                    {
                        minWidth: 200,
                        title: '所属单位',
                        fixed: 'left',
                        key: 'belongOrgName',
                        align: 'center'
                    },
                    {
                        minWidth: 150,
                        title: '申请部门',
                        fixed: 'left',
                        key: 'adminDept',
                        align: 'center'
                    },
                    {
                        minWidth: 150,
                        title: '作业单位',
                        fixed: 'left',
                        key: 'workDept',
                        align: 'center'
                    },
                    {
                        minWidth: 150,
                        title: '作业等级',
                        fixed: 'left',
                        key: 'workGradeName',
                        align: 'center'
                    },
                    {
                        minWidth: 150,
                        title: '作业开始时间',
                        key: 'planStartTime',
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                (this.formatDate(new Date(params.row.applyStartDate), 'yyyy-MM-dd hh:mm'))
                            ]);
                        }
                    },
                    {
                        minWidth: 150,
                        title: '作业结束时间',
                        key: 'planStartTime',
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                (this.formatDate(new Date(params.row.applyEndDate), 'yyyy-MM-dd hh:mm'))
                            ]);
                        }
                    },
                    {
                        minWidth: 150,
                        title: '作业负责人',
                        key: 'workCharge',
                        align: 'center',
                    }
                ],

                ziliaos: [],
                kepuxuanjiaos: [
                    {
                        name: '科普宣教（安全）',
                        type: 1
                    },
                    {
                        name: '科普宣教（环保）',
                        type: 2
                    },
                ],
                loading1: false,
                loading: false,
                center: {lng: 116.404, lat: 39.915},
                zoom: 9,
                location: "北京市",
                keyword: "请输入搜索关键词",
                infoWindow: {
                    info: {}
                },
                dataForm: {
                    grade: [],
                    type: [],
                },
                totalCount: 0,
                nowCount: 0,
                statisticsInfos: {},
                viewManagerFastMenu: false,
                fastMenuLists: [],
                split2: 0.45,
                selectNodeInfo: {},
                buttonLoading: false,
                infosSkip: true,
                infos: [],
                notices: [],
                noticeSkip: true,
                luoBoSkip: true,
                popularization: [],
                popularizationSkip: true,
                remenhuodongLists: [],
                remenhuodongShow: false,
                activeIndex: 0,
                activeIndex2: 0,
                activeIndex3: 0,
                StatisticsTitle: "",
                StatisticsVisible: false,
                JDJCVisible: false,
                AQXZVisible: false,
                HJBZHVisible: false,
                HBXZVisible: false,
                HBWTisible: false,
				JDJCColumn: [
				  {
				    type: 'expand', width: 30,
				    fixed: 'left',
				    _disableExpand: true,
				    render: (h, params) => {
				      return h('Table', {
				        props: {
				          columns: [
				            {key: 'checkContent', title: '检查内容', align: 'center', width: 160, tooltip: true},
				            {key: 'contentIssue', title: '问题描述', align: 'center', minWidth: 200, tooltip: true},
				            {key: 'problemCategoryName', title: '问题类别', align: 'center', minWidth: 150},
				            {key: 'rectifyPlan', title: '整改方案', align: 'center', minWidth: 200, tooltip: true},
				            {key: 'completion', title: '当前进展描述', align: 'center', minWidth: 200, tooltip: true},
				            {key: 'checkTime', title: '检查时间', align: 'center', minWidth: 150, render: this.renderCellDate},
				            {
				              key: 'completeTime',
				              title: '完成时限',
				              align: 'center',
				              minWidth: 150,
				              render: this.renderCellDate
				            }, {
				              key: 'finishTime',
				              title: '完成时间',
				              align: 'center',
				              minWidth: 150,
				              render: this.renderCellDate
				            },
				          ],//表头
				          data: params.row.items,//内部表格展示的数据
				        },
				      })//我这里使用的是表格，大家也可以根据自己的实际情况更换别的组件
				    }
				  },
				  {title: '序号', width: 80, fixed: 'left', align: 'center',  render: (h, params) => {
                            return h('span', params.index + (this.pagedata1.fromPage - 1) * this.pagedata1.pageSize + 1);
                        }
				  },
				  // { key:'perfAssessNum',title: '绩效考核责任书编号',  align: 'center', width: 100},
				  {key: 'companyName', title: '被检查企业', align: 'center', minWidth: 200},
				  {key: 'checkTheme', title: '检查主题', align: 'center', minWidth: 160, tooltip: true},
				  {key: 'inspectionTime', title: '检查时间', align: 'center', minWidth: 150, render: this.renderCellDate},
				  // { key:'inspectionGroupCategory',title: '检查组别',  align: 'center', width: 120,render:(h, params)=>{
				  //   return h('span', this.igcMap && this.igcMap[params.row.inspectionGroupCategory] && this.igcMap[params.row.inspectionGroupCategory].codingName)}, },
				  {key: 'rummager', title: '检查组人员', align: 'center', minWidth: 200},
				  {key: 'contentIssueCount', title: '问题数量', align: 'center', minWidth: 100},
				  {key: 'issueCompletionCount', title: '整改完成问题数量', align: 'center', minWidth: 150},
				  // { key:'contentIssue',title: '检查内容及发现问题',  align: 'center', width: 200 , tooltip:true },
				  // { key:'issueRectificationRequest',title: '问题及整改要求',  align: 'center', width: 200, tooltip:true  },
				  // { key:'issueCompletion',title: '问题整改完成情况',  align: 'center', width: 200, tooltip:true  },
				  // { key:'issueCompletionTime',title: '整改完成时间',  align: 'center', width: 150, render: this.renderCellDate  },
				  {key: 'checkLocation', title: '检查位置', align: 'center', minWidth: 150, tooltip: true},
				  {key: 'createDate', title: '填表时间', align: 'left', minWidth: 120, render: this.renderCellDate},

				],
                AQXZColumn: [
                    {
                        title: '序号',
                        width: 100,
                        fixed: 'left',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.index + (this.pagedata1.fromPage - 1) * this.pagedata1.pageSize + 1);
                        }
                    },
                    {key: 'twoLevelGroupName', title: '所属集团', fixed: 'left', align: 'center'},
                    {key: 'companyName', title: '被罚款单位', fixed: 'left', align: 'center'},
                    {key: 'fineUnitName', title: '罚款单位', align: 'center'},
                    {
                        key: 'fineDate', title: '罚款时间', align: 'center', render: this.renderCellDate

                    },
                    {key: 'fineMoney', title: '罚款金额（万元）', align: 'center'},
                    {key: 'reasonsForFines', title: '罚款事由', align: 'center', ellipsis: true, tooltip: true},
                    {key: 'fineDesc', title: '罚款内容描述', align: 'center', ellipsis: true, tooltip: true},
                ],
                HBWTColumn: [
                    {
                        title: '序号',
                        width: 70,
                        fixed: 'left',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.index + (this.pagedata1.fromPage - 1) * this.pagedata1.pageSize + 1);
                        }
                    },
                   {key: 'stateDesc', title: '当前状态', align: 'center', minWidth: 100, fixed: 'left',},
                   {
                     key: 'gradingDesc', title: '督办', align: 'center', minWidth: 90, fixed: 'left',
                     render: (h, params) => {
                       if (params.row.grading === 'NO_FOLLOW' || !params.row.grading) {
                         return h('Icon', {
                           props: {
                             type: 'ios-star',
                             size: 25,
                           }
                         });
                       } else {
                         return h('Icon', {
                           props: {
                             type: 'ios-star',
                             size: 25,
                             color: params.row.grading === "FOCUS_ON" ? 'red' : params.row.grading === "FOLLOW" ? '#FFB826' : '',
                           }
                         });
                       }
                   
                     }
                   },
                   {key: 'companyName', title: '单位名称', align: 'center', minWidth: 200,},
                   {key: 'problemCategoryName', title: '问题类别', align: 'center', minWidth: 120,},
                   {key: 'problemDesc', title: '问题描述', align: 'center', minWidth: 120, tooltip: true},
                   {
                     key: 'problemSourceDesc',
                     title: '问题来源',
                     align: 'center',
                     minWidth: 120,
                     // render: this.renderCellProblemSource
                   },
                   {key: 'checkLevelDesc', title: '检查级别', align: 'center', minWidth: 110,},
                   {key: 'checkTime', title: '检查时间', align: 'center', minWidth: 100, render: this.renderCellDate},
                   {key: 'completeTime', title: '完成时限', align: 'center', minWidth: 100, render: this.renderCellDate},
                   {key: 'gradingUserName', title: '督办人', align: 'center', minWidth: 100,},
                   {key: 'rectifyPlan', title: '整改方案', align: 'center', minWidth: 120, tooltip: true},
                   {key: 'completion', title: '当前进展描述', align: 'center', minWidth: 100, tooltip: true},
                   // { key:'rectifyUserName',title: '整改人',  align: 'center', minWidth: 100,  },
                   // { key:'depHeadName',title: '环保部门责任人',  align: 'center', minWidth: 100,  },
                   {key: 'belongOrgName', title: '所属二级集团', align: 'center', minWidth: 200,},
                ],
                HJBZHColumn: [
                    {
                        title: '序号',
                        width: 100,
                        fixed: 'left',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.index + (this.pagedata1.fromPage - 1) * this.pagedata1.pageSize + 1);
                        }
                    },
                    { title: '名称', minWidth: 200, align: 'center', key:'name', },
                    { title: '二级集团', minWidth: 200, align: 'center', key:'belongOrgName', },
                    { title: '企业名称', minWidth: 200, align: 'center', key:'companyName', },
                    { title: '现场验收时间', width: 130, align: 'center', key:'selfLevelTime',sortable: "custom",
                        render: (h,params)=>{return h('span',this.renderViewDate(params.row.levelTime))}},
                    { title: '综合评定得分', width: 130, align: 'center', key:'integretedScore',sortable: "custom",
                        render:(h,params)=>{return h('span',params.row.integretedScore)}},
                    { title: '评定等级', width: 120, align: 'center', key:'level',
                        render:(h,params)=>{return h('span',(this.dictMap.enStdCodingCodeIdMap[params.row.level].codingName))}}
                ],
                HBXZColumn: [
                    {
                        title: '序号',
                        fixed: 'left',
                        width: 100,
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.index + (this.pagedata1.fromPage - 1) * this.pagedata1.pageSize + 1);
                        }
                    },
                    {key: 'eventOrgName', title: '事件发生单位', fixed: 'left', align: 'center', minWidth: 240},
                    {key: 'eventDate', title: '事件发生时间', align: 'center', render: this.renderCellDate, minWidth: 140},
                    {key: 'eventSite', title: '事件发生地点', align: 'center', minWidth: 160},
                    {
                        key: 'punishmentTime',
                        title: '事件处罚时间',
                        align: 'center',
                        render: this.renderCellDate,
                        minWidth: 140
                    },
                    {
                        key: 'punishmentType', title: '处罚类别', align: 'center', minWidth: 120, render: (h, params) => {
                            return h('span', this.dictMap['ENEVT-000002'][params.row.punishmentType] && this.dictMap['ENEVT-000002'][params.row.punishmentType].codingName);
                        }
                    },
                    {key: 'penaltyAmount', title: '罚款金额(万元)', align: 'center', minWidth: 120},
                    {key: 'eventDescription', title: '事件经过', align: 'center', minWidth: 230, tooltip: true},
                    {key: 'emergencyMeasure', title: '已经采取的应急措施', align: 'center', minWidth: 230, tooltip: true},
                    {key: 'otherInformation', title: '其他应当报告的情况', align: 'center', minWidth: 230, tooltip: true}
                ],
                hiddenDangerContainer: undefined,
                pipelineContainer: undefined,
                mapContainer: undefined,
                // provincesText: ['上海', '河北', '山西', '内蒙古', '辽宁', '吉林','黑龙江',  '江苏', '浙江', '安徽', '福建', '江西', '山东','河南', '湖北', '湖南', '广东', '广西', '海南', '四川', '贵州', '云南', '西藏', '陕西', '甘肃', '青海', '宁夏', '新疆', '北京', '天津', '重庆', '香港', '澳门', '台湾'],
                provincesText: ['北京', '河北', '天津'],
                timer: {},
                currentTimeOut: 0,
                riskLevelContainer: undefined,
                columns1: [
									{
									  type: 'expand', width: 30,
									  fixed: 'left',
									  _disableExpand: true,
									  render: (h, params) => {
									    return h('Table', {
									      props: {
									        columns: [
									          {key: 'checkContent', title: '检查内容', align: 'center', width: 160, tooltip: true},
									          {key: 'contentIssue', title: '问题描述', align: 'center', minWidth: 200, tooltip: true},
									          {key: 'problemCategoryName', title: '问题类别', align: 'center', minWidth: 150},
									          {key: 'rectifyPlan', title: '整改方案', align: 'center', minWidth: 200, tooltip: true},
									          {key: 'completion', title: '当前进展描述', align: 'center', minWidth: 200, tooltip: true},
									          {key: 'checkTime', title: '检查时间', align: 'center', minWidth: 150, render: this.renderCellDate},
									          {
									            key: 'completeTime',
									            title: '完成时限',
									            align: 'center',
									            minWidth: 150,
									            render: this.renderCellDate
									          }, {
									            key: 'finishTime',
									            title: '完成时间',
									            align: 'center',
									            minWidth: 150,
									            render: this.renderCellDate
									          },
									        ],//表头
									        data: params.row.items,//内部表格展示的数据
									      },
									    })//我这里使用的是表格，大家也可以根据自己的实际情况更换别的组件
									  }
									},
                    {
                        title: '序号', width: 80, fixed: 'left', align: 'center', render: (h, params) => {
													if(params.index == 0) return h('span', "汇总");
                            return h('span', params.index-1 + (this.pagedata1.fromPage - 1) * this.pagedata1.pageSize + 1);
                        }
                    },
                    // {key: 'companyName', title: '被检查企业', fixed: 'left', align: 'center', width: 200},
                    // {key: 'belongOrgId', title: '二级集团', fixed: 'left', align: 'center', width: 200},
                    // {key: 'inspectionTime', title: '检查时间', align: 'center', width: 150, render: this.renderCellDate},
                    // {key: 'inspectionGroupCategory', title: '检查组别', align: 'center', width: 120},
                    // {key: 'rummager', title: '检查组人员', align: 'center', width: 200},
                    // {key: 'issueCount', title: '问题数量', align: 'center', width: 100},
                    // {key: 'issueCompletionCount', title: '整改完成问题数量', align: 'center', width: 150},
                    // {key: 'contentIssue', title: '检查内容及发现问题', align: 'center', width: 200, tooltip: true},
                    // {key: 'issueRectificationRequest', title: '问题及整改要求', align: 'center', width: 200, tooltip: true},
                    // {key: 'issueCompletion', title: '问题整改完成情况', align: 'center', width: 200, tooltip: true},
                    // {
                    //     key: 'issueCompletionTime',
                    //     title: '整改完成时间',
                    //     align: 'center',
                    //     width: 150,
                    //     render: this.renderCellDate
                    // },
                    // {key: 'createDate', title: '填表时间', align: 'left', width: 120, render: this.renderCellDate}
                    {key: 'companyName', title: '被检查企业', align: 'center', minWidth: 200},
                    {key: 'checkTheme', title: '检查主题', align: 'center', minWidth: 160, tooltip: true},
                    {key: 'inspectionTime', title: '检查时间', align: 'center', minWidth: 150,render: this.renderCellDate},
                    {key: 'rummager', title: '检查组人员', align: 'center', minWidth: 200},
                    {key: 'contentIssueCount', title: '问题数量', align: 'center', minWidth: 100},
                    {key: 'issueCompletionCount', title: '整改完成问题数量', align: 'center', minWidth: 150},
                    {key: 'checkLocation', title: '检查位置', align: 'center', minWidth: 150, tooltip: true},
                    {key: 'createDate', title: '填表时间', align: 'left', minWidth: 120, render: this.renderCellDate},
								],
                columns2: [
                    {
                        title: '序号', width: 80, fixed: 'left', align: 'center', render: (h, params) => {
                            return h('span', params.index + (this.pagedata1.fromPage - 1) * this.pagedata1.pageSize + 1);
                        }
                    },
                    {key: 'companyName', title: '企业名称', fixed: 'left', align: 'center', width: 200},
                    {key: 'belongOrgName', title: '二级集团', fixed: 'left', align: 'center', width: 150},
                    {key: 'warningLevel', title: '预警级别', align: 'center', width: 120},
                    {key: 'warningPeriod', title: '预警期间', align: 'center', width: 162},
                    {key: 'responseMeasures', title: '响应措施', align: 'center', tooltip: true}
                ],
                hiddenDangerColumns: [
                    {
                        title: '序号', width: 80, fixed: 'left', align: 'center', render: (h, params) => {
                            return h('span', params.index + (this.pagedata1.fromPage - 1) * this.pagedata1.pageSize + 1);
                        }
                    },
                    {key: 'flowNo', title: '隐患流水号', fixed: 'left', align: 'center', minWidth: 200},
                    {
                        key: 'companyName',
                        title: '排查对象',
                        fixed: 'left',
                        align: 'center',
                        minWidth: 200,
                        render: (h, params) => {
                            return h('div', [
                                h('span', params.row.parentOrgName + '>>' + params.row.projectname || '--')
                            ]);
                        }
                    },
                    {key: 'level', title: '隐患等级', align: 'center', minWidth: 120},
                    {key: 'recPeriod', title: '期限（天）', align: 'center', minWidth: 120},
                    {key: 'userName', title: '上报人', align: 'center', minWidth: 120},
                    {key: 'governTimeStr', title: '上报时间', align: 'center', minWidth: 150},
                ],
                hiddenDangerInfo: [],
                pageSizeArray: [10, 20, 50],
                clickParam: {},
                riskLevelTitle: '',
                riskLevelType: '重大',
                riskLevelVisible: false,
                riskLevelInfo: [],
                riskLevelColumns: [
                    {
                        title: "序号",
                        width: 80,
                        align: "center",
                        fixed: 'left',
                        render: (h, params) => {
                            return h('span', params.index + (this.pagedata.fromPage - 1) * this.pagedata.pageSize + 1);
                        }
                    },
                    {
                        width: 200,
                        minWidth: 150,
                        title: '单位名称',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.row.enRiskInfo.riskUnitName)
                        }
                    },
                    {
                        width: 200,
                        minWidth: 150,
                        title: '车间/部门',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.row.enRiskInfo.riskUnit2)
                        }
                    },
                    {
                        width: 200,
                        minWidth: 150,
                        title: '发生部位',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.row.enRiskInfo.riskUnit3)
                        }
                    }, {
                        width: 200,
                        minWidth: 150,
                        title: '风险源/危险物质',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.row.enRiskInfo.riskSources)
                        }
                    }, {
                        width: 200,
                        minWidth: 150,
                        title: '环境危害和途径',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.row.enRiskInfo.environmentalHazards)
                        }
                    }, {
                        width: 200,
                        minWidth: 150,
                        title: '可能发生事故事件类型',
                        align: 'center',
                        render: (h, params) => {
                            return h('span', params.row.enRiskInfo.eventType)
                        }
                    },
                    {
                        width: 150,
                        title: '风险等级',
                        align: 'center',
                        key: 'rikRankName',
                    },
                    {
                        width: 150,
                        title: '风险防范措施',
                        align: 'center',
                        key: 'manageMeasure',
                        render: (h, params) => {
                            return h('span', params.row.enRiskManage.manageMeasure)
                        },
                        ellipsis: true
                    },
                    {
                        width: 150,
                        title: '责任部门',
                        align: 'center',
                        key: 'dutyOrgName',
                        render: (h, params) => {
                            return h('span', params.row.enRiskManage.dutyOrgName)
                        }
                    },
                    {
                        width: 150,
                        title: '责任人',
                        align: 'center',
                        key: 'dutyPersonName',
                        render: (h, params) => {
                            return h('span', params.row.enRiskManage.dutyPersonName)
                        }
                    },
                ],
                color: ['#ffc400', '#ff6f00', '#00e676', '#03b0fe', '#18ffff'],
                inspectData1: ['中央环保督察组', '生态环境部', '省厅/直辖市厅', '市局', '区县及以下'],
                inspectData2: ['中央安全督察组', '国家应急部', '省厅/直辖市厅', '市局', '区县及以下'],

                proPublicity: {},
                proPublicitySkip: true,
                activeIndex4: 1,

                todoListData: [],
                todoColumns:[
                    {type: 'index', title: '序号', width: 65, align: 'center',},
                    {minWidth: 90,title: '流程名称', align: 'center', key: 'procinstName',tooltip:true},
                    {width: 90, title: '流程状态', key: 'procinstStateName', align: 'center'},
                    {minWidth: 90, title: '上报时间', key: 'createDateStr', align: 'center',tooltip:true,},
                    {
                        title: '操作',
                        key: 'action',
                        width: 65,
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                h('a', {
                                    props: {type: 'primary',},
                                    style: {fontSize: '12px',},
                                    on: {
                                        click: () => {
                                            let user = sessionStorage('userId').getObject('userId');
                                            let formKey = params.row.formKey;
                                            let data = {
                                                taskName: params.row.taskName,
                                                taskId: params.row.taskId,
                                                workId: params.row.workId,
                                                procinstId: params.row.procinstId,
                                                procinstState: params.row.procinstState,
                                                currentTask: params.row.currentTask,
                                                close: false,
                                                viewFlag: false,
                                                userId: user.userId,
                                                reportUserId: params.row.createUserId,
                                            }
                                            this.$router.push({path: "/" + formKey, query: data});
                                        }
                                    }
                                }, '审批'),
                            ])
                        }
                    }
                ],
                noticeListData: [],
                noticeColumns:[
                    {type: 'index', title: '序号', width: 65, align: 'center',},
                    // {width: 100, title: '发送人', key: 'pushUserName', align: 'center'},
                    {minWidth: 85, title: '发送时间', key: 'pushTime', align: 'center',tooltip:true,},
                    {minWidth: 80,title: '内容', align: 'center', key: 'content',tooltip:true},
                    {
                        title: '操作',
                        key: 'action',
                        width: 65,
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                h('a', {
                                    props: {type: 'primary',},
                                    style: {fontSize: '12px',},
                                    on: {
                                        click: () => {
                                            this.clickRow(params.row);
                                            let data = {
                                                id: params.row.message.menuId.substr(0, 5),
                                                fastMenu: params.row.message.route
                                            };
                                            this.$router.push({path: '/modular', query: data});
                                        }
                                    }
                                }, '详情'),
                            ])
                        }
                    }
                ],
                taskBookListData: [],
                taskBookColumns:[
                    {type: 'index', title: '序号', width: 65, align: 'center',},
                    {minWidth: 120,title: '单位名称', align: 'center', key: 'companyName',tooltip:true},
                    {width: 90, title: '当前进度', key: 'progressStr', align: 'center'},
                ],
                detailLoading:false,
                mapContainerSkip:true,
                mapContainerDetailVisible:false,
                mapContainerDetailInfos:[],
                mapContainerColumns:[
                    {type: 'index', title: '编号', width: 80, align: 'center',},
                    {title: '公司名称', align: 'center', key: 'companyName', minWidth: 120},
                    {title: '管理要素', align: 'center', key: 'managementElements', minWidth: 120,
                        render:(h,params)=>{
                            let value = '';
                            this.dictMap['codingList1'].forEach(i =>{
                                if(i.codingCodeId == params.row.managementElements) value = i.codingName;
                            })
                            return h('div',[
                                h('span',value || '--')
                            ]);
                        }
                    },
                    {title: '控制因子', align: 'center', key: 'pollutionFactor', minWidth: 120,
                        render:(h,params)=>{
                            let value = '';
                            this.dictMap['codingList2'].forEach(i =>{
                                if(i.codingCodeId == params.row.pollutionFactor) value = i.codingName;
                            })
                            return h('div',[
                                h('span',value || '--')
                            ]);
                        }
                    },
                    {title: '法律责任', align: 'center', key: 'legalResponsibility', tooltip: true, minWidth: 120,},
                    {title: '法律法规依据', align: 'center', key: 'lawsRegulations', tooltip: true, minWidth: 120},
                    {title: '风险等级', align: 'center', key: 'riskLevel', minWidth: 120,
                        render:(h,params)=>{
                            let value = '';
                            this.dictMap['codingList3'].forEach(i =>{
                                if(i.codingCodeId == params.row.riskLevel) value = i.codingName;
                            })
                            return h('div',[
                                h('span',value || '--')
                            ]);
                        }
                    },
                    {title: '风险控制措施', align: 'center', key: 'riskControlMeasure', minWidth: 200,},
                    {title: '风险量刑预判', align: 'center', key: 'riskJudgement', minWidth: 200,},
                    {title: '问题描述', align: 'center', key: 'problemDesc', minWidth: 200,},
                    {title: '问题原因', align: 'center', key: 'problemReason', minWidth: 200,},
                    {title: '是/否存在行政处罚', align: 'center', key: 'isAdministrativePunishment', minWidth: 120,
                        render:(h,params)=>{
                            let value = '';
                            if(params.row.isAdministrativePunishment == "0")
                                value = "否"
                            else
                                value = "是";
                            return h('div',[
                                h('span',value || '--')
                            ]);
                        }
                    },
                    {title: '行政处罚记录（时间、下达处罚政府部门、金额）', align: 'center', key: 'administrativePunishmentRecord', minWidth: 200,}
                ],
                riskSkip:true,
                userManualSkip:true,
                userManualList:[],
                paramMap: {parentId: '0',categoryId:'db474ed2b65a6449fd583b76c7d6f442',title:'环保工作'},//主键id写死
            }
        },
        computed: {},
        watch: {
            "StatisticsVisible": function (qw, er) {
                if (!qw) {
                    this.$refs.tabs.activeKey = 'name1';
                    let container = echarts.init(this.$refs.analysisContainer);
                    container.clear();
                }
            }
        },
        created() {
            this.$http.get(Api.queryIsTooltip + "/" + sessionStorage('userId').getObject('userId').companyId
                + "/" + sessionStorage('userId').getObject('userId').userId).then((res) => {
                if (res.data.status == 200) {
                    if (res.data.data.display == "true") {
                        this.$Notice.open({
                            title: '提示',
                            desc: '请更新本月的环保画像填报',
                            duration: 0
                        });
                    }
                }
            })
        },
        async mounted() {
            this.currentUserId = sessionStorage('userId').getObject('userId').userId;
            await this.$http.get(Api.queryDictBycode + "ENEVT-000002,TRA-000005,TRA-000003,TRA-000004,eco-00001,eco-00002,eco-00003,ENSTD-000001", {}).then((res) => {
                this.dictMap = {
                    'ENEVT-000002': this.dictListToMap(res.data.data['ENEVT-000002']),
                    'codingList1': res.data.data['eco-00001'],
                    'codingList2': res.data.data['eco-00002'],
                    'codingList3': res.data.data['eco-00003'],
                    'enStdCodingCodeIdMap': this.dictListToMap(res.data.data['ENSTD-000001']),
                };
                this.meetingTypeMap = this.dictListToMap(res.data.data['TRA-000005']);
                this.trainingMethodsMap = this.dictListToMap(res.data.data['TRA-000003']);
                this.evaluationMethodMap = this.dictListToMap(res.data.data['TRA-000004']);
            }).catch(e => {
                this.$Message.error("数据字典获取失败")
            });
            await this.loadPipeline(); //本月检查计划
            await this.loadCockpitCount();//数据统计
            await this.queryPublicity();//公示台账
            await this.loadRer();//风险等级统计
            await this.loadNotice();//通知公告
            await this.queryPopularization();//科普宣教
            await this.check();//企业管理员信息存入缓存

            await this.getToDo();// 我的代办
            await this.taskBookList(); // 任务书情况
            await this.noticeList(); // 我的通知
            await this.loadOneRiskAndCompanyNum();// 各二级集团一级风险与共计家数
            await this.initMap(); // 不可控风险地图
            await this.queryUserManual(this.paramMap); //用户手册(环保)
        },
        methods: {
            ...pageCommonFunction,
            queryUserManual(paramMap){
                this.$http.get(Api.trainingCategory, { params: { parentId: paramMap.categoryId  } }).then(res => {
                    if(res.data.length > 0) {
                        this.userManualList = [];
                        let i = 0;
                        res.data.forEach(item => {
                            i++;
                            if (i < 9) {
                                item.num = i
                                this.userManualList.push(item)
                            }
                        })
                        this.userManualSkip = false
                    }
                }).catch(e => {
                    this.$Message.error("用户手册查询失败");
                    this.userManualSkip = false
                });
            },
            loadOneRiskAndCompanyNum(){
                let oneRiskAndCompanyNumContainer = echarts.init(this.$refs.oneRiskAndCompanyNumContainer);
                this.$http.get(Api.queryEcoPortraitFormByOneRiskAndCompanyNum).then((res) => {
                    if(res.data.status == 200){
                        let option = getOneRiskAndCompanyNumOption();
                        option.xAxis[0].data = res.data.data.xAxis;
                        option.series[0].data = res.data.data.series[0].data;
                        option.series[1].data = res.data.data.series[1].data;
                        oneRiskAndCompanyNumContainer.setOption(option);
                        oneRiskAndCompanyNumContainer.on("click", riskDetails);
                        function riskDetails(param) {
                            console.log(param);
                            event.stopPropagation() // 阻止冒泡
                            // _this.riskLevelType = param.name
                            //_this.pagedata.fromPage=1
                            //_this.pagedata.pageSize=10
                            //   _this.toViewRisk(param.name)
                        }
                        function getOneRiskAndCompanyNumOption(){
                            let option = {
                                tooltip: {
                                    textStyle: {
                                        fontSize: 12
                                    },
                                    trigger: 'axis',
                                    axisPointer: {
                                        type: 'shadow'
                                    }
                                },
                                legend: {
                                    data: ['Ⅰ级风险', '共计家数'],
                                    top:'bottom',
                                    left:'center',
                                    textStyle: {
                                        fontSize: 12
                                    }
                                },
                                grid: {
                                    top: '2%',
                                    left: '3%',
                                    right: '4%',
                                    bottom: '3%',
                                    containLabel: true
                                },
                                xAxis: [
                                    {
                                        type: 'category',
                                        data: [],
                                        axisLabel: {
                                            //x轴文字的配置
                                            show: true,
                                            interval: 0,//使x轴文字显示全
                                            textStyle: {
                                                fontSize: 9,
                                                fontFamily: 'HiraginoSansGB-W3, HiraginoSansGB',
                                                color: 'rgb(51,51,51)',
                                                lineHeight: 14
                                            },
                                            formatter: function (params) {
                                                var newParamsName = "";
                                                var paramsNameNumber = params.length;
                                                var provideNumber = 3; //一行显示几个字
                                                var rowNumber = Math.ceil(paramsNameNumber / provideNumber);
                                                if (paramsNameNumber > provideNumber) {
                                                    for (var p = 0; p < rowNumber; p++) {
                                                        var tempStr = "";
                                                        var start = p * provideNumber;
                                                        var end = start + provideNumber;
                                                        if (p == rowNumber - 1) {
                                                            tempStr = params.substring(start, paramsNameNumber);
                                                        } else {
                                                            tempStr = params.substring(start, end) + "\n";
                                                        }
                                                        newParamsName += tempStr;
                                                    }
                                                } else {
                                                    newParamsName = params;
                                                }
                                                return newParamsName;
                                            }
                                        }
                                    }
                                ],
                                yAxis: [
                                    {
                                        type: 'value'
                                    }
                                ],
                                color: ['#42A5F5', '#FFC310'],
                                series: [
                                    {
                                        name: "Ⅰ级风险", emphasis: {focus: "series"}, type: "bar",
                                        barGap: "1%",
                                        label: {
                                            show: true,
                                        },
                                        itemStyle: {
                                            barBorderRadius: [4, 4, 0, 0],
                                        },
                                    },
                                    {
                                        name: "共计家数", emphasis: {focus: "series"}, type: "bar",
                                        barGap: "1%",
                                        label: {
                                            show: true,
                                        },
                                        itemStyle: {
                                            barBorderRadius: [4, 4, 0, 0],
                                        },
                                    }
                                ]
                            };
                            return option;
                        }
                    }
                });
            },
            initMap(){
                let mCharts = echarts.init(this.$refs.mapContainer);
                this.$http.get('./json/china.json').then((res) => {
                    echarts.registerMap('chinaMap',res.data)
                    let mChartOption = {
                        tooltip: {
                            show: true,
                            formatter: function(datas) {
                                if(datas.data != undefined)
                                    return "不可控风险个数： " +datas.data.detail.value ;
                                else
                                    return "";
                            }
                        },
                        geo: {
                            type: 'map',
                            aspectScale: 1.1, //长宽比
                            map: 'chinaMap', //chinaMap需要和registerMap中的第一个参数保持一致
                            roam: false, // 设置允许缩放以及拖动的效果
                            label: {
                                show: false  //展示标签
                            },
                            zoom: 1.4, //设置初始化的缩放比例,
                            layoutCenter: ['50%', '65%'],//距离左右，上下距离的百分比
                            layoutSize:'100%',//map百分比大小
                            itemStyle: {
                                normal:{ //静态的时候显示的默认样式
                                    areaColor:"#D9EAFD",//地图颜色
                                    borderColor:"#FFFFFF" //地图的各区域间分界线的 及地图边缘 的颜色
                                },
                                emphasis:{
                                    areaColor:"#1999FF" //鼠标悬停时区域变成的颜色
                                }
                            }
                        },
                        series: [
                            {
                                data: [],
                                geoIndex: 0,  //将空气质量的数据和第0个geo配置关联在一起
                                type:'map',
                                itemStyle: {
                                    normal:{
                                        color:"#F9A23E", //地图各地区的点和文字的颜色
                                        shadowBlur:2,
                                        shadowColor:"#FBD784" //地图各地区的点的阴影颜色
                                    }
                                }
                            },
                            {
                                data: [],
                                type: 'effectScatter',
                                coordinateSystem:'geo', //指明散点使用的坐标系统  geo的坐标系统
                                rippleEffect:{
                                    scale: 1
                                },
                                itemStyle: {
                                    normal:{
                                        color:"#F9A23E", //地图各地区的点和文字的颜色
                                        shadowBlur:1,
                                        shadowColor:"#FBD784" //地图各地区的点的阴影颜色
                                    }
                                }
                            }
                        ]
                    }
                    mCharts.setOption(mChartOption)
                    this.$http.get(Api.queryEcoPortraitFormByMap).then(res1 => {
                        let dataList = [];
                        /*获取地图中已有的省、直辖市和特别行政区*/
                        echarts.getMap("chinaMap").geoJson.features.forEach((item) => {
                            dataList.push({
                                // 地区名称
                                name: item.properties.name,
                                // 地区经纬度
                                value: item.properties.center,
                            });
                        });
                        res1.data.data.forEach(item=>{
                            dataList.forEach(item1=>{
                                if(item1.name == item.name){
                                    item1.detail = item;
                                    mChartOption.series[1].data.push(item1);
                                }
                            })
                        })
                        mCharts.setOption(mChartOption)
                        mCharts.on('click','series.effectScatter', params => {
                            this.detailLoading = true;
                            this.mapContainerDetailVisible = true;
                            this.$http.get(Api.queryEcoPortraitFormByMap + "/detail?name="+params.data.name).then(res1 => {
                                if (res1.data.status == 200) {
                                    this.mapContainerDetailInfos = res1.data.data;
                                    this.detailLoading = false;
                                }
                            }).catch(e=>{
                                this.$Message.error('请求失败');
                            })
                        })
                        this.mapContainerSkip = false
                    })
                }).catch(e => {
                    this.mapContainerSkip = false
                })
            },
            taskBookList() {
                let data = {
                    startPage: 1,
                    size: 5,
                    conditions: {
                        year: new Date().getFullYear().toString(),
                        progress: '1',// 有进度的数据
                        assessmentType: '2', //1安全 2环保
                    }
                };
                this.$http.post(Api.queryTaskBook, data).then((res) => {
                    if (res.data.status === 201) {
                        this.$Message.error(res.data.msg);
                    }
                    this.taskBookListData = res.data.data.data;
                    this.taskBookListData.map(item=>{
                        item.progressStr= item.progress+'%'
                    })
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                })
            },
            getToDo() {
                let data = {
                    currentPage: 1,
                    size: 5,
                    // createUserId: this.currentUserId,
                }
                let url = Api.getToDoList;
                this.$http.get(url, {params: data}).then((res) => {
                    this.todoListData = res.data.data;
                    if (this.todoListData != undefined) {
                        this.todoListData.map(item => {
                            item.createDateStr = this.formatDate(new Date(item.createDate), 'yyyy-MM-dd hh:mm:ss')
                            if (item.procinstState == '0' || item.procinstState == null) {
                                item.procinstStateName = '未上报';
                            } else if (item.procinstState == '1') {
                                item.procinstStateName = '审批中';
                            } else if (item.procinstState == '2') {
                                item.procinstStateName = '被退回';
                            } else if (item.procinstState == '3') {
                                item.procinstStateName = '已审批';
                            } else if (item.procinstState == '4' && (item.procinstName == '企业安全总监推荐流程' || item.procinstName == '企业安全总监变更流程')) {
                                item.procinstStateName = '被退回';
                            } else if (item.procinstState == '6' && (item.procinstName == '企业安全总监推荐流程' || item.procinstName == '企业安全总监变更流程')) {
                                item.procinstStateName = '被退回';
                            }
                        })
                    }
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                })
            },
            clickRow(data) {
                this.$http.get(Api.UserNoticeRead + "/" + data.userNoticeId).then((res) => {
                }).catch(e => {
                })
            },
            noticeList() {
                let data = {
                    currentPage: 1,
                    size: 5,
                    isRead: '0',
                    type: '0',
                    userName:'',
                    content:''
                }
                let url = Api.queryNotice + "/" + this.currentUserId;
                this.$http.get(url, {params: data}).then((res) => {
                    this.noticeListData = res.data.data.data;
                    this.noticeListData.map(item=>{
                        item.pushUserName= item.message.pushUserName
                        item.content= item.message.content
                    })
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                })
            },
            queryPublicity() {
                this.$http.get(Api.queryProPublicity + '/all?size=6').then(function (res) {
                    this.proPublicity = res.data.data
                    this.proPublicitySkip = false;
                }, function (res) {
                    this.$Message.error('请求失败');
                });
            },
            check() {
                let url = Api.checkEnvInfoComan;
                this.$http.get(url).then(res => {
                    if (res.data.status == '200') {
                        sessionStorage('envInfoComan').set('check', res.data.data);
                    } else {
                        sessionStorage('envInfoComan').set('check', '1');
                    }
                }).catch(e => {
                    sessionStorage('envInfoComan').set('check', '1');
                    console.error(e);
                    this.$Message.error('查询失败');
                })
            },
            onExpand(row, index) {
                this.dataTable.forEach((item, i) => { //这个循环是为了每次只能展开一个，其他自动收起，不需要可以去掉
                    i !== index ? this.dataTable[i]._expanded = false : '';
                })
                this.dataTable[index]._expanded = !this.dataTable[index]._expanded;
                this.dataTable.sort()
            },
            pushRoute() {
                this.$router.push({path: '/todoList'});
            },
            enterNotice(index) {
                this.notices[index].isBrowsed = "1";
            },
            toViewJC(type) {
                this.pagedata1 = {
                    total: 0, //总条数
                    fromPage: 1,//从n条开始
                    pageSize: 10//每页多少条
                };
                this.ZDWRVisible = false;
                this.AQJCVisible = true;
                this.JDJCVisible = false;
                this.AQXZVisible = false;
                this.HJBZHVisible = false;
                this.HBWTisible = false;
                this.HBXZVisible = false;
                this.StatisticsVisible = true;
                this.type = type;
                this.loading = true;
                if (type == 1) this.StatisticsTitle = '内部环保检查'; else this.StatisticsTitle = '内部安全检查';
                this.queryJC();
            },
            queryJC() {
                this.loading = true;
                let user = sessionStorage('userId').getObject('userId');
                // let date = new Date;
                // let url = Api.cockpitCount + '/detail/' + user.companyId + '/' + date.getFullYear() + '/' + this.type + "?startPage=" + this.pagedata1.fromPage + "&size=" + this.pagedata1.pageSize;
								let url = Api.querySaSuperviseInspect
								let data = {
								    startPage: this.pagedata1.fromPage,
								    size: this.pagedata1.pageSize,
								    conditions: {
											companyId:user.companyId,
											rptType:'1',
											year: new Date().getFullYear()
										}
								};
                this.$http.post(url,data).then((res) => {
                    this.pagedata1.total = res.data.data.totalSize;
                    this.dataTable = res.data.data.data;
                    this.loading = false;
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                })

                // this.$http.get(Api.cockpitCount + 'detail/count/' + user.companyId + '/' + date.getFullYear() + '/' + this.type).then((res) => {
                //     let container = echarts.init(this.$refs.analysisContainer);
                //     let option = this.getInspectOption(this.type);
                //     let legend = this.type == 1 ? this.inspectData1 : this.inspectData2;
                //     let temp = 0;
                //     legend.forEach(i => {
                //         res.data.data.forEach(j => {
                //             if (i == j['codingName']) {
                //                 option.series.push({
                //                     name: j['codingName'],
                //                     type: 'bar',
                //                     label: {
                //                         normal: {
                //                             show: true,
                //                             textBorderColor: '#333',
                //                             textBorderWidth: 2
                //                         }
                //                     },
                //                     data: j['count']
                //                 });
                //                 temp = 1;
                //             }
                //         });
                //         if (temp != 1) {
                //             option.series.push({
                //                 name: i,
                //                 type: 'bar',
                //                 label: {
                //                     normal: {
                //                         show: true,
                //                         textBorderColor: '#333',
                //                         textBorderWidth: 2
                //                     }
                //                 },
                //                 data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
                //             });
                //             temp = 0;
                //         }

                //     })
                //     container.setOption(option);
                // }).catch(e => {
                //     this.$Message.error("数据获取失败")
                // })
            },
            toViewZWUTQYJ() {
                this.pagedata1 = {
                    total: 0, //总条数
                    fromPage: 1,//从n条开始
                    pageSize: 10//每页多少条
                };
                this.AQJCVisible = false;
                this.ZDWRVisible = true;
                this.JDJCVisible = false;
                this.AQXZVisible = false;
                this.HJBZHVisible = false;
                this.HBWTisible = false;
                this.HBXZVisible = false;
                this.loading = true;
                this.StatisticsVisible = true;
                this.StatisticsTitle = '重污染天气预警';
                this.queryZWUTQYJ();
            },
            queryZWUTQYJ() {
                this.loading = true;
                let user = sessionStorage('userId').getObject('userId');
                let date = new Date;
                let queryMonth = "";
                if (date.getMonth() < 10)
                    queryMonth = date.getFullYear() + "-0" + (date.getMonth() + 1)
                else
                    queryMonth = date.getFullYear() + "-" + (date.getMonth() + 1)
                let url = Api.cockpitCount + '/warningDays/' + user.companyId + '/' + queryMonth;
                this.$http.get(url + "?startPage=" + this.pagedata1.fromPage + "&size=" + this.pagedata1.pageSize).then((res) => {
                    if (res.data.data.data.length > 0) {
                        res.data.data.data.forEach(item => {
                            const sty = item.warningLevel == '红色' ? 'table-info-cell-red' : item.warningLevel == '橙色' ? 'table-info-cell-orage' : item.warningLevel == '黄色' ? 'table-info-cell-yellow' : item.warningLevel == '蓝色' ? 'table-info-cell-blue' : ''
                            item.cellClassName = {warningLevel: sty}
                        })
                    }
                    this.pagedata1.total = res.data.data.totalSize;
                    this.dataTable = res.data.data.data;
                    this.loading = false;
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                })
            },
            queryJDJC() {
                this.loading = true;
                var date = new Date();
                let data = {
                    startPage: this.pagedata1.fromPage,
                    size: this.pagedata1.pageSize,
                    conditions: {
						rptType:'1',
                        companyId: sessionStorage('userId').getObject('userId').companyId,
						inspectionTimeFrom: date.getFullYear()+'-01-01 00:00:00',
                    }
                };
                let url = Api.querySaSuperviseInspect
                this.$http.post(url, data).then((res) => {
                    this.dataTable = res.data.data.data;
					if(this.dataTable.length>0){
						this.dataTable.shift()
						// this.dataTable.splice(0,1)
					}
                    this.pagedata1.total = res.data.data.totalSize;
                    this.loading = false;
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                })
            },
            toViewJDJC() {
                this.pagedata1 = {
                    total: 0, //总条数
                    fromPage: 1,//从n条开始
                    pageSize: 10//每页多少条
                };
                this.StatisticsTitle = "监督检查详情"
                this.StatisticsVisible = true;
                this.AQJCVisible = false;
                this.ZDWRVisible = false;
                this.JDJCVisible = true;
                this.AQXZVisible = false;
                this.HJBZHVisible = false;
                this.HBWTisible = false;
                this.HBXZVisible = false;
                this.loading = true;
                if (this.statisticsInfos.enSuperviseInspectNum > 0) {
                    this.queryJDJC();
                } else {
                    this.dataTable = [];
                    this.pagedata1.total = 0;
                    this.loading = false;
                }
            },

            queryHBXZ() {
                this.loading = true;
                var date = new Date();
                let data = {
                    startPage: this.pagedata1.fromPage,
                    size: this.pagedata1.pageSize,
                    conditions: {
                        orgId: sessionStorage('userId').getObject('userId').companyId,
                        eventTypeIds: '("ENEVT-000001000000003")',
                        year: date.getFullYear()
                    }
                };
                let url = Api.queryEnvEventSend
                this.$http.post(url, data).then((res) => {
                    this.dataTable = res.data.data.data;
                    this.pagedata1.total = res.data.data.totalSize;
                    this.loading = false;
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                })
                this.$http.get(Api.countDeleteEnvEventSend, {
                    params: {
                        eventTypeIds: "ENEVT-000001000000003",
                        year: date.getFullYear()
                    }
                }).then((res) => {
                    let container = echarts.init(this.$refs.analysisContainer);
                    let option = this.getMeetingOption();
                    option.series.push({
                        type: 'bar',
                        label: {
                            normal: {
                                show: true,
                                textBorderColor: '#333',
                                textBorderWidth: 2
                            }
                        },
                        data: res.data.data
                    });
                    container.setOption(option);
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                })
            },
            toViewHBXZ() {
                this.pagedata1 = {
                    total: 0, //总条数
                    fromPage: 1,//从n条开始
                    pageSize: 10//每页多少条
                };
                this.StatisticsTitle = "环保行政处罚详情"
                this.StatisticsVisible = true;
                if (this.statisticsInfos.administrativeSanction > 0) {
                    this.AQJCVisible = false;
                    this.ZDWRVisible = false;
                    this.JDJCVisible = false;
                    this.AQXZVisible = false;
                    this.HJBZHVisible = false;
                    this.HBWTisible = false;
                    this.HBXZVisible = true;
                    this.queryHBXZ();
                } else {
                    this.AQJCVisible = false;
                    this.ZDWRVisible = false;
                    this.JDJCVisible = false;
                    this.AQXZVisible = false;
                    this.HJBZHVisible = false;
                    this.HBWTisible = false;
                    this.HBXZVisible = true;
                    this.dataTable = [];
                    this.pagedata1.total = 0;
                }
            },
            queryHJBZH() {
                this.loading = true;
                let date = new Date();
                let user = sessionStorage('userId').getObject('userId');
                let data = {
                    startPage: this.pagedata1.fromPage,
                    size: this.pagedata1.pageSize,
                    conditions: {
                        year:date.getFullYear(),
                        companyId:user.companyId,
                        levelType: 2,
                        auditState:'1'
                    }
                };
                let url = Api.queryEnvSelfCheck
                this.$http.post(url, data).then((res) => {
                    this.dataTable = res.data.data.data;
                    this.pagedata1.total = res.data.data.totalSize;
                    this.loading = false;
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                })
            },
            toViewHJBZH() {
                this.pagedata1 = {
                    total: 0, //总条数
                    fromPage: 1,//从n条开始
                    pageSize: 10//每页多少条
                };
                if (this.statisticsInfos.evaluationResult > 0) {
                    this.AQJCVisible = false;
                    this.ZDWRVisible = false;
                    this.JDJCVisible = false;
                    this.AQXZVisible = false;
                    this.HJBZHVisible = true;
                    this.HBWTisible = false;
                    this.HBXZVisible = false;
                    this.StatisticsTitle = "环境标准化验收详情"
                    this.StatisticsVisible = true;
                    this.queryHJBZH();
                } else {
                    this.AQJCVisible = false;
                    this.ZDWRVisible = false;
                    this.JDJCVisible = false;
                    this.AQXZVisible = false;
                    this.HJBZHVisible = true;
                    this.HBWTisible = false;
                    this.HBXZVisible = false;
                    this.StatisticsTitle = "环境标准化验收详情"
                    this.StatisticsVisible = true;
                    this.dataTable = [];
                }
            },
            queryHBWT() {
                this.loading = true;
                var date = new Date();
                let data = {
                    startPage: this.pagedata1.fromPage,
                    size: this.pagedata1.pageSize,
                    conditions: {
						accountType:'2',
						state: ['START', 'DELAY', 'NOT_RECTIFIED'],
                        companyId: sessionStorage('userId').getObject('userId').companyId,
                        year: date.getFullYear()
                    }
                };
                let url = Api.queryQuestionAccount
                this.$http.post(url, data).then((res) => {
                    this.loading = false;
                    this.dataTable = res.data.data.data;
                    this.pagedata1.total = res.data.data.totalSize;
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                })
            },
            toViewHBWT() {
                this.pagedata1 = {
                    total: 0, //总条数
                    fromPage: 1,//从n条开始
                    pageSize: 10//每页多少条
                };
                if (this.statisticsInfos.enAccountNum > 0) {
                    this.AQJCVisible = false;
                    this.ZDWRVisible = false;
                    this.JDJCVisible = false;
                    this.AQXZVisible = false;
                    this.HJBZHVisible = false;
                    this.HBWTisible = true;
                    this.HBXZVisible = false;
                    this.StatisticsTitle = "待闭环问题详情"
                    this.StatisticsVisible = true;
                    this.queryHBWT();
                } else {
                    this.AQJCVisible = false;
                    this.ZDWRVisible = false;
                    this.JDJCVisible = false;
                    this.AQXZVisible = false;
                    this.HJBZHVisible = false;
                    this.HBWTisible = true;
                    this.HBXZVisible = false;
                    this.StatisticsTitle = "待闭环问题详情"
                    this.StatisticsVisible = true;
                    this.dataTable = [];
                    this.pagedata1.total = 0;
                }
            },
            ziliaoInfo(id, name) {
                this.$router.push({path: '/wholePage', query: {name: name, type: 3, id: id}});
            },
            getZiLiaoInfos(obj) {
                for (var i = 0; i < obj.length; i++) {
                    let item = obj[i]
                    let data = {page: 1, rows: 7, categoryId: item.id};
                    data = Object.assign(data);
                    this.$http.get(Api.materialsInfo, {
                        params: data,
                    }).then((res) => {
                        item.children = res.data.data;
                        this.infoObj[item.name] = res.data.data;
                        if (this.info.length == 0) {
                            this.info = res.data.data;
                        }
                    })
                }
            },
            mouseOver(name, index) {
                this.activeIndex = index
                this.info = this.infoObj[name]
            },

            queryPopularization() {
                this.$http.get(Api.popularization + '/cockpit', {
                    params: {
                        startPage: 1,
                        pageSize: 6
                    }
                }).then(function (res) {
                    this.popularization = res.data;
                    this.popularization['safe'].forEach(item => {
                        item.createDate = this.formatDate(new Date(item.createDate), 'yyyy-MM-dd');
                    })
                    this.popularization['environment'].forEach(item => {
                        item.createDate = this.formatDate(new Date(item.createDate), 'yyyy-MM-dd');
                    })
                    this.popularizationSkip = false;
                }, function (res) {
                    this.$Message.error('请求失败');
                });
            },


            loadCockpitCount() {
                let date = new Date();
                let user = sessionStorage('userId').getObject('userId');
                let url = Api.cockpitCount + date.getFullYear() + '/' + user.companyId+"?isHomepage=true";
                this.$http.get(url).then(res => {
                    if (res.data.status == 200) {
                        this.statisticsInfos = res.data.data;
                    }
                });
            },
            loadNotice() {
                this.$http.get(Api.getCockpitNotice + "?startPage=1&size=10&type=1&userId=" + this.currentUserId + "&publishOrgId=" + sessionStorage('userId').getObject('userId').companyId).then(res => {
                    if (res.data.status == 200) {
                        this.notices = res.data.data;
                        this.notices['safe'].forEach(item => {
                            item.createDate = this.formatDate(new Date(item.createDate), 'yyyy-MM-dd');
                        })
                        this.notices['environment'].forEach(item => {
                            item.createDate = this.formatDate(new Date(item.createDate), 'yyyy-MM-dd');
                        })
                        this.noticeSkip = false;
                    }
                });
            },
            loadPipeline() {
                // 本月安全检查计划
                let _this = this;
                let container = echarts.init(this.$refs.pipelineContainer);
                this.$http.get(Api.findPlanToOrg + "/2" , {planMonth:this.formatDate(new Date(),'yyyy-MM')}).then(res => {
                    if (res.data.status === 201) {
                        this.$Message.error(res.data.msg);
                    }
                    if (res.data.status === 200) {
                        let obj = {
                            plan: [],
                            actual: [],
                            orgNames: [],
                        }
                        res.data.data.forEach(item => {
                            obj.plan.push(item.planNum);
                            obj.orgNames.push(item.orgName);
                            obj.actual.push(item.actual);
                        });

                        let option = getPlanToOrgOption(obj);
                        container.setOption(option)
                    }
                    window.onresize = container.resize;
                }).catch(e => {
                    console.log(e)
                    this.$Message.error("查询失败")
                });
                function getPlanToOrgOption(data) {
                    return {
                        tooltip: {
                            trigger: 'axis',
                            textStyle: {
                                fontSize: 12
                            },
                            axisPointer: {
                                type: 'shadow'
                            }
                        },
                        legend: {
                            data: ['计划', '实际'],
                            top:'bottom',
                            left:'center',
                            textStyle: {
                                fontSize: 12
                            }
                        },
                        grid: {
                            top: '2%',
                            left: '3%',
                            right: '4%',
                            bottom: '3%',
                            containLabel: true
                        },
                        toolbox: {
                            show: true,
                            orient: 'vertical',
                            left: 'right',
                            top: 'center',
                        },
                        xAxis: [
                            {
                                type: 'category',
                                axisTick: {show: false},
                                data: data.orgNames,
                                axisLabel: {
                                    show: true,
                                    interval: 0,
                                    textStyle: {
                                        fontSize: 9,
                                        fontFamily: 'HiraginoSansGB-W3, HiraginoSansGB',
                                        color: 'rgb(51,51,51)',
                                        lineHeight: 14
                                    },
                                    formatter: function (params) {
                                        var newParamsName = "";
                                        var paramsNameNumber = params.length;
                                        var provideNumber = 3; // 一行显示几个字 然后就超过字数就会自动换行
                                        var rowNumber = Math.ceil(paramsNameNumber / provideNumber);
                                        if (paramsNameNumber > provideNumber) {
                                            for (var p = 0; p < rowNumber; p++) {
                                                var tempStr = "";
                                                var start = p * provideNumber;
                                                var end = start + provideNumber;
                                                if (p == rowNumber - 1) {
                                                    tempStr = params.substring(start, paramsNameNumber);
                                                } else {
                                                    tempStr = params.substring(start, end) + "\n";
                                                }
                                                newParamsName += tempStr;
                                            }
                                        } else {
                                            newParamsName = params;
                                        }
                                        return newParamsName;
                                    },
                                },
                            }
                        ],
                        yAxis: [
                            {
                                type: 'value',
                            }
                        ],
                        color: ['#42A5F5', '#FFC310'],
                        series: [
                            {
                                name: '计划',
                                type: 'bar',
                                // barWidth : 30,
                                barGap: "1%",
                                label: {
                                    show: true,
                                },
                                itemStyle: {
                                    barBorderRadius: [4, 4, 0, 0],
                                },
                                data: data.plan,

                            },
                            {
                                name: '实际',
                                type: 'bar',
                                barGap: "1%",
                                label: {
                                    show: true,
                                    textStyle: {
                                        // fontSize: 9,
                                    },
                                },
                                // barWidth: 30,
                                itemStyle: {
                                    barBorderRadius: [4, 4, 0, 0],
                                },

                                data: data.actual,
                            },

                        ]
                    }
                }
            },

            sizeChange1(pageSize) {
                this.pagedata1.pageSize = pageSize;
                this.pagedata1.fromPage = 1;
                this.query();
            },
            pageChange1(pageNum) {
                this.pagedata1.fromPage = pageNum;
                this.query();
            },
            query() {
                if (this.JDJCVisible == true) {
                    this.queryJDJC();
                    // this.queryAQSG();
                } else if (this.HBWTisible == true)
                    this.queryHBWT();
                else if (this.HBXZVisible == true)
                    this.queryHBXZ();
                else if (this.HJBZHVisible == true)
                    this.queryHJBZH();
                else if (this.AQJCVisible == true)
                    this.queryJC();
                else if (this.ZDWRVisible == true)
                    this.queryZWUTQYJ();
            },
            loadRer() {
                let date = new Date();
                let _this = this
                let container1 = echarts.init(this.$refs.derContainer);
                let user = sessionStorage('userId').getObject('userId');
                _this.$http.get(Api.queryEnvriskStatistic + '/' + date.getFullYear()+ "/" + user.companyId).then((res) => {
                    if (res.data.status == 200) {

                        let level = res.data.data;
                        level.forEach(item=>{
                            item.name=  item.name + "色风险";
                        })
                        let option = this.getRiskLevelOption();
                        option.series[0].data = level;
                        container1.setOption(option);
                        container1.on("click", riskDetails);

                        function riskDetails(param) {
                            event.stopPropagation() // 阻止冒泡
                            _this.riskLevelType = param.name
                            _this.pagedata.fromPage = 1
                            _this.pagedata.pageSize = 10
                            _this.riskLevelTitle = _this.riskLevelType==='红色风险'?'风险等级(重大)': _this.riskLevelType==='橙色风险'?'风险等级(较大)': _this.riskLevelType==='黄色风险'?'风险等级(一般)':_this.riskLevelType==='蓝色风险'?'风险等级(低)':'';
                            _this.toViewRisk(param.name)
                        }
                        this.riskSkip = false
                    }
                }).catch(res=>{
                    this.riskSkip = false
                })
            },
            toViewRisk(name) {
                this.riskLevelVisible = true;
                this.loading = true;
                let url = Api.environmentalList
                let data = {
                    startPage: this.pagedata.fromPage,
                    size: this.pagedata.pageSize,
                    orgName : sessionStorage('userId').getObject('userId').companyName,
                    rikColor:name.slice(0,1)
                }
                this.$http.get(url, {params: data}).then((res) => {
                    res.data.data.data.forEach(item => {
                        const sty = item.rikColor == '红' ? 'table-info-cell-red' : item.rikColor == '橙' ? 'table-info-cell-orage' : item.rikColor == '黄' ? 'table-info-cell-yellow' : item.rikColor == '蓝' ? 'table-info-cell-blue' : ''
                        item.cellClassName = {rikColor: sty}
                    })
                    this.riskLevelInfo = res.data.data.data;
                    this.pagedata.total = res.data.data.totalSize;
                    this.loading = false;
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                    this.loading = false;
                    this.pagedata.total = 0
                })
            },
            sizeChangeRisk(size) {
                this.pagedata.pageSize = size
                this.toViewRisk(this.riskLevelType)
            },
            pageChangeRisk(pagenum) {
                this.pagedata.fromPage = pagenum
                this.toViewRisk(this.riskLevelType)
            },
            // formatDate(date, fmt) {
            //     if (/(y+)/.test(fmt)) {
            //         fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
            //     }
            //     let o = {
            //         'M+': date.getMonth() + 1,
            //         'd+': date.getDate(),
            //         'h+': date.getHours(),
            //         'm+': date.getMinutes(),
            //         's+': date.getSeconds()
            //     };
            //     for (let k in o) {
            //         if (new RegExp(`(${k})`).test(fmt)) {
            //             let str = o[k] + '';
            //             fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : this.padLeftZero(str));
            //         }
            //     }
            //     return fmt;
            // },
            padLeftZero(str) {
                return ('00' + str).substr(str.length);
            },
            getBingOption() {
                let option = {

                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow'
                        }
                    },
                    grid: {
                        top: '14%',
                        left: '1%',
                        right: '4%',
                        bottom: '1%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'value',
                        show: false,
                        boundaryGap: [0, 0.01],
                        splitLine: {show: false},
                        axisTick: {show: false},
                        axisLine: {show: false}
                    },
                    yAxis: {
                        type: 'category',
                        data: [],
                        axisLine: {
                            show: false,
                            lineStyle: {
                                color: '#757575'
                            }
                        },
                        axisTick: {show: false}
                    },
                    series: [
                        {
                            name: '数量',
                            type: 'bar',
                            barWidth: 8,
                            barGap: '80%',
                            barCategoryGap: '50%',
                            z: 10,
                            data: [],
                            itemStyle: { // 柱子样式
                                normal: {
                                    barBorderRadius: [0, 10, 10, 0],
                                    color: '#42A5F5', // 柱状图颜色
                                    label: {
                                        show: true, // 显示文本
                                        position: 'right', // 数据值位置
                                        textStyle: {
                                            color: '#000'
                                        },
                                    }
                                }
                            }
                        },
                        {
                            type: 'bar',
                            data: [46, 46, 46, 46, 46, 46, 46, 46],
                            tooltip: {show: false},
                            barMinHeight: 30,
                            barWidth: 10,
                            barMaxWidth: 100,
                            barGap: '-100%', // 两个柱子之间的距离，如果要重叠设置为-100%
                            itemStyle: {
                                normal: {
                                    color: '#F0F2F5', // 柱子颜色，作为底层背景
                                    label: {
                                        show: false,
                                        position: 'right',
                                        testStyle: {
                                            color: '#000'
                                        }
                                    }
                                }
                            }
                        }
                    ]
                };
                return option;
            },
            getRiskLevelOption() {
                let option = {
                    tooltip: {
                        trigger: 'item',
                        formatter: '{a} <br/>{b}: {c} ({d}%)'
                    },
                    legend: {
                        orient: 'vertical',
                        left: 10,
                        data: ['重大', '较大', '一般', '低']
                    },
                    color: ['#FD5C50', '#FF9800', '#FDD835', '#40C4FF'],
                    series: [
                        {
                            name: '风险级别',
                            type: 'pie',
                            radius: ['50%', '70%'],
                            center: ['45%', '50%'],
                            label: {
                                formatter: '{@2012} ({d}%)'
                            },
                            data: [],
                            emphasis: {
                                itemStyle: {
                                    shadowBlur: 10,
                                    shadowOffsetX: 0,
                                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                                }
                            }
                        }
                    ]
                };
                return option;
            },
            getRiskTypeOption() {
                let option = {
                    tooltip: {
                        trigger: 'item',
                        formatter: '{a} <br/>{b}: {c} ({d}%)'
                    },
                    legend: {
                        orient: 'vertical',
                        right: 10,
                        data: ['设备设施风险', '作业流程风险', '人员岗位风险', '环境氛围风险']
                    },
                    color: ['#42A5F5', '#FF3E80', '#FFC310', '#1DE9B6'],
                    series: [
                        {
                            name: '风险类型',
                            type: 'pie',
                            radius: '60%',
                            center: ['40%', '50%'],
                            label: {
                                formatter: '{@2012} ({d}%)'
                            },
                            data: [],
                            emphasis: {
                                itemStyle: {
                                    shadowBlur: 10,
                                    shadowOffsetX: 0,
                                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                                }
                            }
                        }
                    ]
                };
                return option;
            },
            formatDate(date, fmt) {
                if (typeof date == 'string') {
                    return date;
                }
                if (!fmt) fmt = "yyyy-MM-dd hh:mm:ss";
                if (!date || date == null) return null;
                let o = {
                    'M+': date.getMonth() + 1, // 月份
                    'd+': date.getDate(), // 日
                    'h+': date.getHours(), // 小时
                    'm+': date.getMinutes(), // 分
                    's+': date.getSeconds(), // 秒
                    'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
                    'S': date.getMilliseconds() // 毫秒
                }
                if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
                for (let k in o) {
                    if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
                }
                return fmt
            },
            getLastMonth(date, fmt) {
                if (typeof date == 'string') {
                    return date;
                }
                if (!fmt) fmt = "yyyy-MM-dd hh:mm:ss";
                if (!date || date == null) return null;
                let month = 0;
                if (date.getMonth() == 0) {
                    date = new Date(date.getFullYear() - 1, 12, 1);
                    date.getMonth() + 1;
                } else {
                    month = date.getMonth();
                }
                let o = {
                    'M+': month, // 月份
                    'd+': date.getDate(), // 日
                    'h+': date.getHours(), // 小时
                    'm+': date.getMinutes(), // 分
                    's+': date.getSeconds(), // 秒
                    'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
                    'S': date.getMilliseconds() // 毫秒
                }
                if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
                for (let k in o) {
                    if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
                }
                return fmt
            },
            getInspectOption() {
                let option = {
                    color: this.color,
                    legend: {
                        data: this.type == 1 ? this.inspectData1 : this.inspectData2
                    },
                    xAxis: [
                        {
                            type: 'category',
                            axisTick: {show: false},
                            data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value'
                        }
                    ],
                    series: []
                };
                return option;

            },
            getBriefingOption() {
                let option = {
                    color: this.color,
                    legend: {
                        data: []
                    },
                    xAxis: [
                        {
                            type: 'category',
                            axisTick: {show: false},
                            data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value'
                        }
                    ],
                    series: []
                };
                return option;
            },
            getBriefingCountOption() {
                let option = {
                    color: this.color,
                    legend: {
                        data: []
                    },
                    xAxis: [
                        {
                            type: 'category',
                            axisTick: {show: false},
                            data: []
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value'
                        }
                    ],
                    series: []
                };
                return option;
            },
            getMeetingOption() {
                let option = {
                    color: this.color,
                    legend: {
                        data: []
                    },
                    xAxis: [
                        {
                            type: 'category',
                            axisTick: {show: false},
                            data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value'
                        }
                    ],
                    series: []
                };
                return option;
            },
        }
    }
</script>

<style scoped>
    @import "../../../index.css";
    .artical {
        margin-left: 10px;
        display: flex;
    }

    .articals_child {
        width: 96%;
        display: flex;
        justify-content: space-between;
    }

    .articals_child_title {
        flex: auto;
        width: 0;
        font-size: 15px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #5C5C5C;
        line-height: 30px;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }

    .articals_child_title_notice {
        font-size: 15px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #5C5C5C;
        line-height: 30px;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }

    .red_point {
        position: relative;
        margin-right: 5px;
    }

    .red_point::before {
        content: " ";
        border: 3px solid red; /*设置红色*/
        border-radius: 3px; /*设置圆角*/
        position: absolute;
        z-index: 1000;
        right: 0%;
        margin-right: -10px;
        margin-top: 12px;
    }

    .articals_child_date {
        margin-left: 10px;
        width: 95px;
        font-size: 15px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #A3A3A3;
        flex-shrink: 0;
        line-height: 32px;
    }

    .ivu-select-dropdown ul {
        list-style-type: none;
    }

    .ivu-select-dropdown ul li:before {
        display: inline-block;
        content: "▶";
        padding-right: 10px;
        color: #FEA6A5;
        font-size: 6px;
        line-height: 32px;
    }

    .ivu-select-dropdown ul li:first-child {
        display: inline-block;
        content: "▶";
        padding-right: 10px;
        color: #FEA6A5;
        font-size: 6px;
        line-height: 32px;
    }

    .other-people {
        height: 275px;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
    }

    .info-div {
        height: 80px;
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    .info-div:hover, .rowDiv:hover{
        cursor: pointer
    }

    .info-div-left {
        /*width: 55px;
          height: 55px;
          border-radius: 50%;
          background-color:#757575;
          display:flex;
          justify-content:center;
          align-items:center;*/
    }

    .info-div-left-img {
        width: 55px;
        height: 55px;
    }

    .info-div-right {
        display: flex;
        flex-direction: column;
        height: 55px;
        justify-content: space-between;
        align-items: center;
        margin-left: 5px;
    }

    .info-div-right-title {
        height: 12px;
        font-size: 12px;
        font-family: Microsoft YaHei;
        font-weight: 400;

        line-height: 22px;
    }

    .info-div-right-bottom {
        display: flex;
        align-items: flex-end;
    }

    .info-div-right-num {
        font-size: 24px;
        font-family: Microsoft YaHei;
        font-weight: bold;
        line-height: 22px;
    }

    .info-div-right-danwei {
        font-size: 12px;
        font-family: Microsoft YaHei;
        font-weight: bold;
        margin-left: 5px;
    }

    .artical {
        width: 100%;
        /*margin-left: 15px;*/
        display: flex;
    }

    .articals_child {
        width: 96%;
        display: flex;
        justify-content: space-between;
    }

    .articals_child_date {
        margin-left: 10px;
        width: 95px;
        font-size: 15px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #A3A3A3;
        flex-shrink: 0;
        line-height: 32px;
    }

    .articals_child:hover .articals_child_date, .articals_child:hover .articals_child_title:hover, .articals_child_title_notice:hover {
        cursor: pointer;
        color: #F65555;
    }

    .top_artical_div {
        background-color: #fff;
        height: 235px;
        width: 100%;
        padding-bottom: 15px;
    }

    .top_artical_div ul {
        list-style-type: none;
        height: 100%;
        overflow: hidden;
    }

    .top_artical_div ul li:before {
        display: inline-block;
        content: "▶";
        padding-right: 10px;
        color: #FEA6A5;
        font-size: 6px;
        line-height: 32px;
    }

    .top_common_title {
        height: 40px;
        display: flex;
        width: 100%;
        border-bottom: 3px solid #e3e3e3;
        justify-content: space-between;
        margin-bottom: 15px;
    }

    .top_img {
        height: 220px;
        width: 100%;
    }

    .top_common_title_left_title {
        /*border-bottom: 3px solid #e43534;*/
        border-left: 3px solid #e43534;
        padding-left: 10px;
        font-size: 18px;
        font-family: Microsoft YaHei;
        font-weight: 700;
        color: #333333;
        height: 30px;
    }
    

    .top_common_title_right {
        width: 45px;
        height: 15px;
        line-height: 15px;
        font-size: 15px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #E43534;
        line-height: 30px;
    }

    .top_center_leader {
        height: 275px;
        width: 100%;
        display: flex;
        flex-direction: column;
    }
    /*用户手册*/
    .statisticsDiv1{
        background-size: 100% 100%;
        height:90px;
        background-image: url("../../../assets/leaderPerformance/1.png");
        color:white;
        display: flex;
        flex-direction: column;
        justify-content:center;
        padding-bottom: 3%;
    }
    .statisticsDiv2{
        background-size: 100% 100%;
        height:90px;
        background-image: url("../../../assets/leaderPerformance/2.png");
        color:white;
        display: flex;
        flex-direction: column;
        justify-content:center;
        padding-bottom: 3%;
    }
    .statisticsDiv0{
        background-size: 100% 100%;
        height:90px;
        background-image: url("../../../assets/leaderPerformance/3.png");
        color:white;
        display: flex;
        flex-direction: column;
        justify-content:center;
        padding-bottom: 3%;
    }
    .rowDiv{
        display: flex;
        justify-content: center;
        font-size: 14px;
        font-family: HiraginoSansGB-W6, HiraginoSansGB;
        font-weight: normal;
        color: #FFFFFF;
        line-height: 27px;
    }


</style>
